package ic.doc.co2nudge.services;

import ic.doc.co2nudge.shared.GraphType;
import ic.doc.co2nudge.shared.model.DataType;
import ic.doc.co2nudge.shared.model.ForecastData;
import ic.doc.co2nudge.shared.model.TransportType;
import ic.doc.co2nudge.shared.model.Trip;
import ic.doc.co2nudge.shared.model.TripOption;
import ic.doc.co2nudge.shared.model.User;
import ic.doc.co2nudge.shared.model.UserData;

import java.util.Date;
import java.util.HashMap;
import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;

public interface DataServiceAsync {
	
	void storeDictionary(List<TransportType> transportTypes, 
		 AsyncCallback<Boolean> callback);

	void storeTransportTypes(List<TransportType> types, 
			AsyncCallback callback);
	
	void storeTrip(Trip trip, User user,
			AsyncCallback<Boolean> callback);
	
	void storeUser(User user, AsyncCallback callback);
		
	void storeUsers(List<User> users, AsyncCallback callback);
	
	void storeTripOption(TripOption option, 
			AsyncCallback<Boolean> callback);
	
	void getTransportTypes(AsyncCallback<List<TransportType>> callback);
	
	void getAllTrips(AsyncCallback<List<Trip>> callback);

	void getTripsByYear(Date date, User user,
			AsyncCallback<List<Trip>> callback);

	void getUser(String username, String password, 
			AsyncCallback<User> callback);
	
	void loadDictionaryData(AsyncCallback<HashMap<String,List<? extends DataType>>> callback);
	
	void generateTripOptions(Double distance, 
			AsyncCallback<List<TripOption>> callback);
	
	void getTripDistance(String from, String to, 
			AsyncCallback<Double> callback);
	
	void loadStatisticalData(GraphType graphType, 
			AsyncCallback< HashMap<String, Double>> callback);
	
	void loadPredictionData(User user, Date date, 
			AsyncCallback<ForecastData> callback);

	void loadAnalysisData(AsyncCallback<List<UserData>> callback);
		
	void calcUsersCosts( AsyncCallback<HashMap<String, Double>> callback);
}